package com.battle.service.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.battle.pojo.dto.authorization.GetAuthorizedByTargetIdDto;
import com.battle.pojo.dto.authorization.ResourceAuthorizationDto;
import com.battle.pojo.entity.Authorization;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
* 【描 述】：
* 【环 境】：J2SE
* 【详 细】：
*
*/
@Repository
public interface AuthorizationMapper extends BaseMapper< Authorization > {


    /**
     * 获取对象的可用资源汇总
     * @param targetIds
     * @return
     */
    List<Long> getAvailableResourceByTargetIds(@Param("targetIds") List<Long> targetIds);

    /**
     *  批量移除目标授权
     * @param targetIds
     */
    void bathRemoveTargetAuthorized(@Param("targetIds") List<Long> targetIds);


    /**
     * 获取授权对象的资源授权
     * @param dto
     * @return
     */
    List<ResourceAuthorizationDto> getAuthorizedByTargetId(GetAuthorizedByTargetIdDto dto);

}